<template>
  <div class="">
    <input type="text" v-focus v-back>
  </div>
</template>

<script>
import {ref,reactive,toRefs,directives} from 'vue';
export default {
directives:{ // 自定义指令
  focus:{ // focus 指令名称
    mounted(el,binding,vnode,prevVNode){
    //   console.log(binding);
      el.focus();
    }
  }
}
}

</script>
<style lang="scss" scoped>
</style>